.class final Lcom/melesta/engine/FacebookOperations$8;
.super Ljava/lang/Object;
.source "FacebookOperations.java"

# interfaces
.implements Lcom/facebook/Request$Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/melesta/engine/FacebookOperations;->facebookGetUserInfo(Ljava/lang/String;II)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation


# instance fields
.field final synthetic val$callback:I

.field final synthetic val$me:Lcom/melesta/engine/EngineActivity;

.field final synthetic val$user_data:I

.field final synthetic val$user_facebook_id:Ljava/lang/String;


# direct methods
.method constructor <init>(Ljava/lang/String;Lcom/melesta/engine/EngineActivity;II)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 559
    iput-object p1, p0, Lcom/melesta/engine/FacebookOperations$8;->val$user_facebook_id:Ljava/lang/String;

    iput-object p2, p0, Lcom/melesta/engine/FacebookOperations$8;->val$me:Lcom/melesta/engine/EngineActivity;

    iput p3, p0, Lcom/melesta/engine/FacebookOperations$8;->val$user_data:I

    iput p4, p0, Lcom/melesta/engine/FacebookOperations$8;->val$callback:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onCompleted(Lcom/facebook/Response;)V
    .locals 13
    .parameter "response"

    .prologue
    .line 564
    :try_start_0
    invoke-virtual {p1}, Lcom/facebook/Response;->getError()Lcom/facebook/FacebookRequestError;

    move-result-object v7

    .line 565
    .local v7, facebookError:Lcom/facebook/FacebookRequestError;
    if-eqz v7, :cond_4

    const/4 v9, 0x1

    .line 566
    .local v9, isErrorState:Z
    :goto_0
    if-nez v9, :cond_1

    .line 567
    invoke-virtual {p1}, Lcom/facebook/Response;->getGraphObject()Lcom/facebook/model/GraphObject;

    move-result-object v8

    .line 568
    .local v8, graphObject:Lcom/facebook/model/GraphObject;
    if-eqz v8, :cond_5

    .line 569
    const-string v0, "id"

    invoke-interface {v8, v0}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    .line 570
    .local v2, id:Ljava/lang/String;
    iget-object v0, p0, Lcom/melesta/engine/FacebookOperations$8;->val$user_facebook_id:Ljava/lang/String;

    const-string v1, "me"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 571
    iget-object v0, p0, Lcom/melesta/engine/FacebookOperations$8;->val$me:Lcom/melesta/engine/EngineActivity;

    iput-object v2, v0, Lcom/melesta/engine/EngineActivity;->mFacebookUserId:Ljava/lang/String;

    .line 573
    :cond_0
    const-string v0, "name"

    invoke-interface {v8, v0}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    .line 574
    .local v3, name:Ljava/lang/String;
    const-string v0, "email"

    invoke-interface {v8, v0}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v11

    .line 575
    .local v11, object:Ljava/lang/Object;
    invoke-virtual {v11}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    .line 576
    .local v4, email:Ljava/lang/String;
    const-string v0, "picture"

    invoke-interface {v8, v0}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Lorg/json/JSONObject;

    .line 577
    .local v10, jo:Lorg/json/JSONObject;
    const-string v0, "data"

    invoke-virtual {v10, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    const-string v1, "url"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 579
    .local v5, pic:Ljava/lang/String;
    iget-object v12, p0, Lcom/melesta/engine/FacebookOperations$8;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v0, Lcom/melesta/engine/FacebookOperations$8$1;

    move-object v1, p0

    invoke-direct/range {v0 .. v5}, Lcom/melesta/engine/FacebookOperations$8$1;-><init>(Lcom/melesta/engine/FacebookOperations$8;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v12, v0}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V

    .line 591
    .end local v2           #id:Ljava/lang/String;
    .end local v3           #name:Ljava/lang/String;
    .end local v4           #email:Ljava/lang/String;
    .end local v5           #pic:Ljava/lang/String;
    .end local v8           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v10           #jo:Lorg/json/JSONObject;
    .end local v11           #object:Ljava/lang/Object;
    :cond_1
    :goto_1
    if-eqz v9, :cond_3

    .line 592
    if-eqz v7, :cond_2

    .line 593
    const-string v0, "engine"

    invoke-virtual {v7}, Lcom/facebook/FacebookRequestError;->getErrorType()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 594
    const-string v0, "engine"

    invoke-virtual {v7}, Lcom/facebook/FacebookRequestError;->getErrorMessage()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 597
    :cond_2
    iget-object v0, p0, Lcom/melesta/engine/FacebookOperations$8;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v1, Lcom/melesta/engine/FacebookOperations$8$2;

    invoke-direct {v1, p0}, Lcom/melesta/engine/FacebookOperations$8$2;-><init>(Lcom/melesta/engine/FacebookOperations$8;)V

    invoke-virtual {v0, v1}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 615
    .end local v7           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v9           #isErrorState:Z
    :cond_3
    :goto_2
    return-void

    .line 565
    .restart local v7       #facebookError:Lcom/facebook/FacebookRequestError;
    :cond_4
    const/4 v9, 0x0

    goto :goto_0

    .line 587
    .restart local v8       #graphObject:Lcom/facebook/model/GraphObject;
    .restart local v9       #isErrorState:Z
    :cond_5
    const/4 v9, 0x1

    goto :goto_1

    .line 605
    .end local v7           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v8           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v9           #isErrorState:Z
    :catch_0
    move-exception v6

    .line 606
    .local v6, e:Ljava/lang/Exception;
    invoke-static {v6}, Lcom/melesta/engine/Error;->processException(Ljava/lang/Exception;)V

    .line 607
    iget-object v0, p0, Lcom/melesta/engine/FacebookOperations$8;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v1, Lcom/melesta/engine/FacebookOperations$8$3;

    invoke-direct {v1, p0}, Lcom/melesta/engine/FacebookOperations$8$3;-><init>(Lcom/melesta/engine/FacebookOperations$8;)V

    invoke-virtual {v0, v1}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V

    goto :goto_2
.end method
